# -*- coding: utf-8 -*-
# Created by liangfuting on 2020/6/17
# Copyright (c) 2020 liangfuting. All rights reserved.


from django.urls import path,re_path,include
from rbac.views import role,userinfo,menu,permissions

app_name='rbac'


urlpatterns=[
    #如果有namespace则用自己的，如果没有则用上级的
    # path('test/',include('rbac.testurl',)),
    #role url
    re_path(r'^role/list/$',role.role_list,name='role_list'),
    re_path(r'^role/add/$',role.role_add,name='role_add'),
    re_path(r'^role/edit/(?P<pk>\d+)/$',role.role_edit,name='role_edit'),
    re_path(r'^role/del/(?P<pk>\d+)/$',role.role_del,name='role_del'),
    #userinfo url
    # re_path(r'^user/list/$',userinfo.user_list,name='user_list'),
    # re_path(r'^user/add/$',userinfo.user_add,name='user_add'),
    # re_path(r'^user/edit/(?P<pk>\d+)/$',userinfo.user_edit,name='user_edit'),
    # re_path(r'^user/del/(?P<pk>\d+)/$',userinfo.user_del,name='user_del'),
    # re_path(r'^user/reset/passwd/(?P<pk>\d+)/$',userinfo.reset_passwd,name='reset_passwd'),
    #menu url
    re_path(r'^menu/list/$',menu.menu_list,name='menu_list'),
    re_path(r'^menu/add/$',menu.menu_add,name='menu_add'),
    re_path(r'^menu/edit/(?P<pk>\d+)/$',menu.menu_edit,name='menu_edit'),
    re_path(r'^menu/del/(?P<pk>\d+)/$',menu.menu_del,name='menu_del'),
    #second menu url
    re_path(r'^second_menu/add/$', menu.second_menu_add, name='second_menu_add'),
    re_path(r'^second_menu/edit/(?P<pk>\d+)/$', menu.second_menu_edit, name='second_menu_edit'),
    re_path(r'second_menu/del/(?P<pk>\d+)/$', menu.second_menu_del, name='second_menu_del'),
    #permission_url
    re_path(r'^permission/add/(?P<second_menu_id>\d+)/$', permissions.permission_add, name='permission_add'),
    re_path(r'^permission/edit/(?P<pk>\d+)/$', permissions.permission_edit, name='permission_edit'),
    re_path(r'^permission/del/(?P<pk>\d+)/$', permissions.permission_del, name='permission_del'),
    re_path(r"^multi_permissions/$", permissions.multi_permissions, name='multi_permissions'),
    re_path(r"^multi_permissions/del/(?P<pk>\d+)/$", permissions.multi_permissions_del, name='multi_permissions_del'),
    # path('multi_permission/edit/<str:pk>',permission.multi_permission_edit,name='multi_permission_edit'),
    re_path(r"^distribute/permissions/$",permissions.distribute_permissions,name='distribute_permissions'),
    ]

# print(urlpatterns)